import api from "api";
import router from "../router";
export const logout = () => {
  const user_id = localStorage.getItem("user_id");
  if (user_id) {
    api.get(`/user/logout?user_id=${user_id}`);
  }
  clearInterval(window.onlineTimer);
  window.onlineTimer = null;
  localStorage.clear();
  router.push({
    name: "login",
  })
};

